package com.buddy.learn.controller;

import com.buddy.learn.producer.RocketMqRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author buddy
 */@RestController
@RequestMapping("/mq")
public class MqController {

     @Autowired
     private RocketMqRepository rocketMqRepository;
    @GetMapping("/_send")
    public void send(@RequestParam  String msg) {
        rocketMqRepository.sendMessage(msg, "test-topic");
    }
}
